{include file="header.html"}
<body class="gr">

<div class="navBar">
	<a class="left" href="javascript:history.back()"><i class="return"></i></a>
	<div class="titleView-x">确认订单</div>
</div>

<div class="cart-jiesuan main-top">
	<div class="view">
		<div class="title ge-bottom">基本信息</div>
		<div class="row ge-bottom"><span>{$data.name}</span><span>姓名</span></div>
		<div class="row ge-bottom"><span>{$data.idcard}</span><span>身份证号</span></div>
		<div class="row ge-bottom"><span>{$data.city}</span><span>参保城市</span></div>
		<div class="row"><span>{$data.type}</span><span>户口性质</span></div>
		
		<div class="ge-top"></div>
		<div class="title ge-bottom">缴纳月份</div>
		<div class="row"><span>{$data.month}</span><span>缴费年月</span></div>

		{if $data.coupon}
		<div class="ge-top"></div>
		<div class="title ge-bottom">优惠券</div>
		<select name="sn" id="sn"  class="row" style="width: 96.5%;background: white;border: 0; background: transparent; color: #666; font-size: 0.12rem;">
			<option>请选择优惠券</option>
			{foreach from=$data.coupon item=g}
			{if {$g->is_city}==1}
			<option style="padding-left:5px;" value="{$g->sn}" data-money="{$g->coupon_money}">{$g->name} ￥{$g->coupon_money}</option>
			{/if}
			{/foreach}
		</select>
		{/if}

		<div class="ge-top"></div>
		<div class="title ge-bottom">费用信息</div>
		<div class="row ge-bottom"><span>￥{$data.total}</span><span>社保费用</span></div>
		<div class="row ge-bottom"><span>￥{$data.gjj_total}</span><span>公积金费用</span></div>
		<div class="row ge-bottom"><span>￥{$data.service_money}</span><span>社保服务费</span></div>
		<div class="row ge-bottom"><span>￥{$data.gjj_service_money}</span><span>公积金服务费</span></div>
		<div class="row"><span class="price" >￥<font id="total_price">{$data.total_price}</font></span><span>合计费用</span></div>

	</div>

	<div class="buttonView">
		<a href="javascript:void(0)" class="btn">确认支付</a>
	</div>
	
	<form action="wap.php?app=cart&act=order_pay" method="post">
	<input type="hidden" id="person_id" name="person_id" value="{$person_id}" />
	<input type="hidden" id="province_id" name="province_id" value="{$province_id}" />
	<input type="hidden" id="city_id" name="city_id" value="{$city_id}" />
	<input type="hidden" id="casy_id" name="casy_id" value="{$casy_id}" />
	<input type="hidden" id="month" name="month" value="{$month}" />
	<input type="hidden" id="gjj" name="gjj" value="{$gjj}" />
	<input type="hidden" id="c_sn" name="c_sn" value="" />
	</form>
</div>

{include file="footer.html"}
<script>
$(function(){
    $('#sn').change(function () {
		var money = $(this).find('option:selected').data('money');
		if (money){
            var total_price = {$data.total_price}-money;
		} else {
            var total_price = {$data.total_price};
        }
		$('#total_price').text(total_price.toFixed(2))

        var sn = $(this).val();
		$("#c_sn").val(sn);
    });

	$('.btn').click(function(){
		if(!$('#person_id').val().length){
			$.overloadError('请选择参保人');
			return;
		}
		if(!$('#province_id').val().length || !$('#city_id').val().length){
			$.overloadError('请选择参保地');
			return;
		}
		if(!$('#casy_id').val().length){
			$.overloadError('请选择参保方案');
			return;
		}
		if(!$('#month').val().length){
			$.overloadError('请选择参保月份');
			return;
		}
		$('form').submit();
	});
});
</script>
